package com.project_doctor.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
/**
 * @TableName t_conversation
 */
@TableName(value ="t_conversation")
public class Conversation {
    @TableId(type = IdType.AUTO)
    private Long id;

    private Long participantId;
    @TableField(exist = false,update="false")
    private Doctor participant;

    private Long starterId;
    @TableField(exist = false,update="false")
    private Doctor starter;

    private Long latestMessageId; // 新增：最后一条消息的发送者ID
    @TableField(exist = false,update="false")
    private Message latestMessage;

    private Integer isReadCon;
    private Integer unreadCount;

    private Date createTime;

    private Date updateTime;

    @TableField(exist = false,update="false")
    private List<Message> messages;
}